<%@page import="com.yymmarket.forum.cache.ForumCache,com.yymmarket.forum.admin.AdminBean,com.yymmarket.forum.bbs.*,com.yymmarket.forum.user.UserBean,com.yymmarket.forum.user.UserService,com.yymmarket.forum.util.*,com.yymmarket.forum.bbs.ContentBean,com.yymmarket.forum.bbs.BBSService,com.yymmarket.framework.WebAction"%><%@ 
page contentType="text/vnd.wap.wml;charset=utf-8"%><%
response.setHeader("Cache-Control","no-cache");
ContentAction webAction = new ContentAction(request,response);
int id = webAction.getParameterInt("id");
String action = webAction.getParameterString("action");
Integer uid = SessionUtil.getSessionUserId(request);
ContentService contentService = ContentService.getInstance();
%><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml><card title="操作">
<p><%
//加精
if(action.equals("prime")) {
	boolean flag = false;
	int fid = webAction.getParameterInt("fid");
	AdminBean adminBean = ForumCache.getAdminBean(LevelUtil.TYPE_BBS,fid,uid);
	if(adminBean!=null&&adminBean.getAdminLevel()>=LevelUtil.BBS_LEVEL_FUBANZHU) {
		int value = webAction.getParameterInt("value");
		flag = contentService.updatePrime(id,value);
	}
%><%=flag?"操作成功":"操作失败,请稍后再试" %><br/>
<a href="content.jsp?id=<%=id %>">返回帖子</a><br/><%
} else if(action.equals("lock")) {
	boolean flag = false;
	int fid = webAction.getParameterInt("fid");
	AdminBean adminBean = ForumCache.getAdminBean(LevelUtil.TYPE_BBS,fid,uid);
	if(adminBean!=null&&adminBean.getAdminLevel()>=LevelUtil.BBS_LEVEL_FUBANZHU) {
		int value = webAction.getParameterInt("value");
		flag = contentService.updateReadOnly(id,value);
	}
%><%=flag?"操作成功":"操作失败,请稍后再试" %><br/>
<a href="content.jsp?id=<%=id %>">返回帖子</a><br/><%
	
} else if(action.equals("top")) {
	boolean flag = false;
	int fid = webAction.getParameterInt("fid");
	AdminBean adminBean = ForumCache.getAdminBean(LevelUtil.TYPE_BBS,fid,uid);
	if(adminBean!=null&&adminBean.getAdminLevel()>=LevelUtil.BBS_LEVEL_BANZHU) {
		int value = webAction.getParameterInt("value");
		flag = contentService.updateTop(id,value);
	}
%><%=flag?"操作成功":"操作失败,请稍后再试" %><br/>
<a href="content.jsp?id=<%=id %>">返回帖子</a><br/><%
	
} else if(action.equals("delete")) {
	int fid = webAction.getParameterInt("fid");
	if(webAction.hasParam("c")) {
		boolean flag = false;
		ContentBean content = contentService.getContentById(id);
		AdminBean adminBean = ForumCache.getAdminBean(LevelUtil.TYPE_BBS,fid,uid);
		if(uid==content.getUserId()||(adminBean!=null&&adminBean.getAdminLevel()>=LevelUtil.BBS_LEVEL_BANZHU)) {
			flag = contentService.deleteContent(id,uid);
		}
%><%=flag?"操作成功":"操作失败,请稍后再试" %><br/>
<a href="content.jsp?id=<%=id %>">返回帖子</a><br/><%
	} else {
%><a href="result.jsp?id=<%=id%>&amp;fid=<%=fid%>&amp;action=delete&amp;c=1">确认删除?</a><br/>
<a href="content.jsp?id=<%=id %>">返回帖子</a><br/><%
	}
}

%>
</p>
</card>
</wml>